﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using kTudu.Web.Models;
using System.Data.Entity;

namespace kTudu.Web.Applications
{
    public class RolApplication : BaseApplication
    {
        #region Constructores

        public RolApplication(Entities _context)
            : base(_context)
        {

        }

        public RolApplication()
        {
        }

        #endregion

        public Rol[] GetAll()
        {
            return _context.Rols.ToArray();
        }

        public Rol Get(int id)
        {
            return _context.Rols
                           .Include(x => x.UserClients)
                           .First(x => x.IdRol == id);
        }
    }
}